#pragma once
#include "BondDetailData.h"
#include <QWidget>
#include <QPushButton>
#include <widgets/SDialog.h>
#include <qbtools/message/MessagePoster.h>
class QLabel;
class SImage;
class DetailData;
class QGridLayout;

struct CPurchaseCtrl
{
	QString m_strUnderWriterId;//机构id
	QString m_strUnderWriterName;//机构名
	QString m_strDiscri;//描述
	QString m_strSuggest;//建议利率
	QString m_strPrice;//预中标价格
	QString m_strVol;//预中标量
};

//申购机构
class BondDetailPrcInstitute : public QWidget
{
	Q_OBJECT
public:
    BondDetailPrcInstitute(QWidget* p, QSharedPointer<DetailData> data);
    void setBondInfo(QSharedPointer<DetailData> data);
	void refreshData();
protected:
	void getBondInfo();
	void getUnderwriterImage(QString allowId);
private:
	CBondInfo		m_bondInfo;
	const char*		m_strCombKey;
	bool			m_bValidInfo;
    QSharedPointer<DetailData>		m_data = nullptr;
	QGridLayout*	m_grid = nullptr;
	std::vector<CPurchaseCtrl>  m_vctCtrl;
};
